﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;



class NKdivK_N
{
    static void Main()
    {
        int n;
        int k;
        do
        {
            Console.Write("Enter N > 1: ");
            n = Convert.ToInt32(Console.ReadLine());
            Console.Write("Enter K > {0}: ", n);
            k = Convert.ToInt32(Console.ReadLine());
            if ((n < 1) || (k < 1))
            {
                Console.WriteLine("!!! (1<N<K)");
            }
        } while ((n < 1) || (k < 1));
        decimal faktN = 1;
        decimal faktK = 1;
        decimal faktDiv = 1;
        for (int i = n; i > 1; i--)
        {
            faktN *= i;
        }
        for (int j = k; j > 1; j--)
        {
            faktK *= j;
        }
        for (int l = (k - n); l > 1; l--)
        {
            faktDiv *= l;
        }
        decimal result = (faktN * faktK) / faktDiv;
        Console.WriteLine("N{0}! * K{1}! / (K-N){2}! == {3}", faktN, faktK, faktDiv, result);
    }
}

